package com.jvyou.framework.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jvyou.common.core.domain.model.PageResult;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import com.jvyou.framework.domain.entity.SysSetting;
import com.jvyou.framework.service.SysSettingService;
import com.jvyou.framework.mapper.SysSettingMapper;
import com.jvyou.framework.domain.dto.SysSettingDto;

/**
 * 系统设置表(SysSetting)表服务实现类
 *
 * @author 橘柚
 * @since 2025-05-30 11:01:30
 */
@RequiredArgsConstructor
@Service("sysSettingService")
public class SysSettingServiceImpl extends ServiceImpl<SysSettingMapper, SysSetting> implements SysSettingService {

    /**
     * 构建查询条件包装器
     * @param dto 查询参数
     * @return QueryWrapper
     */
    private QueryWrapper<SysSetting> getWrapper(SysSettingDto dto) {
        QueryWrapper<SysSetting> ew = new QueryWrapper<>();
        return ew;
    }

    @Override
    public List<SysSetting> listSysSetting(SysSettingDto dto) {
        return list(getWrapper(dto));
    }

    @Override
    public PageResult<SysSetting> pageSysSetting(SysSettingDto dto) {
        IPage<SysSetting> page = new Page<>(dto.getCurrent(), dto.getPageSize());
        page = page(page, getWrapper(dto));
        return PageResult.success(page);
    }

}
